package com.yilin.tms.user.mapper;


import com.yilin.tms.core.entity.data.statistics.StatisticsTrends;
import com.yilin.tms.core.entity.data.statistics.user.*;
import com.yilin.tms.core.entity.user.UserType;
import com.yilin.tms.core.entity.user.account.Account;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface UserStatisticsMapper {
    Map<String, Object> getCreditAssetsData(@Param("userId") String userId, @Param("organizeId") String organizeId);

    /**
     * 用户总数
     */
    UserStatistics getUserCount(@Param("loginUser") Account loginUser);

    /**
     * 用户类型类型饼图
     */
    UserTypeCake getUserTypeCake(@Param("loginUser") Account loginUser);

    /**
     * 角色分布饼图
     */
    UserRoleCake getUserRoleCake(@Param("loginUser") Account loginUser);

    /**
     * 用户活跃趋势折线
     */
    List<StatisticsTrends> getUserActiveTrends(@Param("loginUser") Account loginUser);

    /**
     * 用户注册趋势折线
     */
    List<StatisticsTrends> getUserRegistrationTrends(@Param("loginUser") Account loginUser);

    /**
     * 总孵化数,年孵化数,月孵化数
     */
    HatchStatistics getHatchCount(@Param("loginUser") Account loginUser);

    /**
     * 孵化趋势
     */
    List<StatisticsTrends> getHatchTrends(@Param("loginUser") Account loginUser);

    /**
     * 货主总数，月新增数，周新增数，日新增数
     */
    ShipperStatistics getShipperCount(@Param("loginUser") Account loginUser);

    /**
     * 货主类型分布饼图
     */
    OrganTypeCake getOrganTypeCake(@Param("loginUser") Account loginUser, @Param("userType") UserType userType);

    /**
     * 货主新增趋势
     */
    List<StatisticsTrends> getShipperRegisterTrends(@Param("loginUser") Account loginUser);

    /**
     * 货主活跃趋势
     */
    List<StatisticsTrends> getShipperActiveTrends(@Param("loginUser") Account loginUser);

    /**
     * 货主或车主角色分布饼图
     */
    UserRoleCake getShipperOrTruckerRoleCake(@Param("loginUser") Account loginUser, @Param("userType") UserType userType);

    /**
     * 车主总数，月新增数，日新增数
     */
    TruckerStatistics getTruckerCount(@Param("loginUser") Account loginUser);

    /**
     * 车主新增趋势
     */
    List<StatisticsTrends> getTruckerRegisterTrends(@Param("loginUser") Account loginUser);

    /**
     * 车主活跃趋势
     */
    List<StatisticsTrends> getTruckerActiveTrends(@Param("loginUser") Account loginUser);
}
